using System;
using System.Collections.Generic;
using System.Text;

namespace Lutos.Data
{
    public class RegionElement
    {
        public RegionElement()
        {}
        public RegionElement(RegionTree.RegionNode node)
        {
            if (node.parent != null)
                this.FID = node.parent.id;
            else
                this.FID = 0;
            this.CreationTime = node.CreationTime;
            this.EmptyTime = node.EmptyTime;
            this.Flag = node.flag;
            this.ID = node.id;
            this.IsActive = node.isActive;
            this.Name = node.name;
            this.NodeType = node.nodeType;
            this.UserID = node.user.User_ID;
            this.ZipCode = node.Zipcode;
        }
        public static RegionElement[] GetMany(RegionTree.RegionNode[] array)
        {
            RegionElement[] ret = new RegionElement[array.Length];
            for(int i=0; i<array.Length; i++)
            {
                ret[i] = new RegionElement(array[i]);
            }
            return ret;
        }

        public int FID;
        public DateTime CreationTime;
        public DateTime EmptyTime;
        public int Flag;
        public int ID;
        public bool IsActive;
        public string Name;
        public int NodeType;
        public int UserID;
        public string ZipCode;
    }
}
